﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;
using BrnMall.Web.Framework;
using Senparc.Weixin.MP;
using BrnMall.Services;

namespace BrnMall.Web.Mobile.controllers
{
	public class WeiXinController : BaseMobileController
	{
		[HttpGet]
		[ActionName("Index")]
		public ActionResult AccessValidate(string signature, string timestamp, string nonce, string echostr)
		{
			var joinconfig = AdminWeiXinService.GetJoinConfigInfo();
			var isValid = CheckSignature.Check(signature, timestamp, nonce, joinconfig.Token);
			return isValid ? Content(echostr) : null;
		}
		[HttpPost]
		[ActionName("Index")]
		public ActionResult Message()
		{
			return null;
		}
	}
}
